package com.sgsg.reflectandfactorymodule;

import android.app.Activity;
import android.content.Context;

public class DatabaseHelper {



    public static IUser createUser(Activity activity,String type){
        try {
            Class<?> clz = Class.forName(activity.getPackageName()+type+"Dbuser");
            IUser instance = (IUser) clz.newInstance();
            return instance;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }



    public static IDepartment createDepartment(Activity activity,String type){
        try {
            Class<?> clz = Class.forName(activity.getPackageName()+type+"Dbdepartment");
            IDepartment instance = (IDepartment) clz.newInstance();
            return instance;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
